package com.kuang.service;

import com.kuang.dao.UserMapper;
import com.kuang.pojo.User;

import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService{

    private UserMapper userMapper;

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    public int deleteUser(int id) {
        return userMapper.deleteUserById(id);
    }

    public User updateUserByName(String username) {

        return userMapper.updateUserByName(username);
    }
    public User queryByIdUser(int id) {
        return userMapper.queryById(id);
    }

    public List<User> queryAllUser() {
        return userMapper.queryAllUser();
    }

    public User updateUserPassword(Map<String, Object> map) {
        return userMapper.updateUserPassword(map);
    }

    public User queryUserByName(String username, String password) {
        return userMapper.queryUserByName(username,password);
    }
}
